home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Directorty Opus 5 - Magellan
/
Opus 5 - Magellan.iso
/
Extras
/
LhALZXDirDOps5
/
LZXDir-handler
< prev
next >
Wrap
Text File
|
1995-06-28
|
3KB
|
103 lines
/*
$VER: LZXDir-handler 1.1 (26.6.95)
modified by tINIC/mAXIMUM
Custom handler for LZXDir.dopus5.
*/
options results
options failat 11
parse arg portname
parse var portname '.' portno
address value portname
if ~show('l','rexxsupport.library') then
call addlib('rexxsupport.library',0,-30,0)
call openport('LZXDir-handler'portno)
dopus addtrap copy 'LZXDir-handler'portno
dopus addtrap move 'LZXDir-handler'portno
dopus addtrap delete 'LZXDir-handler'portno
dopus addtrap parent 'LZXDir-handler'portno
dopus addtrap makedir 'LZXDir-handler'portno
do forever
if waitpkt('LZXDir-handler'portno) then do
packet=getpkt('LZXDir-handler'portno)
event=getarg(packet,0)
handle=getarg(packet,1)
name=getarg(packet,2)
user=getarg(packet,3)
if upper(event)='MAKEDIR' then do
cmd='MAKEDIR'
address command 'Run >NIL: <NIL: rx DOpus5:arexx/LZXDir.dopus5' cmd portname handle '"'name'"'
end
if upper(event)='COPY' then do
cmd='COPY'
address command 'Run >NIL: <NIL: rx DOpus5:arexx/LZXDir.dopus5' cmd portname handle '"'name'"'
end
if upper(event)='MOVE' then do
cmd='MOVE'
address command 'Run >NIL: <NIL: rx DOpus5:arexx/LZXDir.dopus5' cmd portname handle '"'name'"'
end
if upper(event)='DELETE' then do
cmd='DELETE'
address command 'Run >NIL: <NIL: rx DOpus5:arexx/LZXDir.dopus5' cmd portname handle '"'name'"'
end
if upper(event)='PARENT' then do
lister query handle path
winpath=result
oldpath=getarg(packet,4)
test=upper(winpath)
newpos=lastpos('/',winpath,lastpos('/',winpath)-1)
newpos1=lastpos(':',winpath,lastpos('/',winpath)-1)
if newpos1>newpos then newpos=newpos1
newpath=left(winpath,newpos)
lister read handle '"'newpath'"' force
address command 'Run >NIL: <NIL: rx DOpus5:arexx/LZXDir.dopus5 GETDIR' portname ' ' handle '""'
end
if upper(event)='DOUBLECLICK' then do
lister query handle entry '"'name'"' stem fileinfo.
if fileinfo.type>0 then do /* it's a dir */
name=name'/'
cmd='GETDIR'
end
else
if pos(upper(right(name,4)),'.LZX')>0 then /* archive in an archive */
cmd='GETDIR'
else
cmd='DOUBLECLICK'
address command 'Run >NIL: <NIL: rx DOpus5:arexx/LZXDir.dopus5' cmd portname handle '"'name'"'
end
if upper(event)='INACTIVE' then do
lister query handle path
winpath=result
oldpath=getarg(packet,4)
test=upper(winpath)
if winpath=left(oldpath,length(winpath))&(pos('.LZX/',test)>0) then /* user did parent */
address command 'Run >NIL: <NIL: rx DOpus5:arexx/LZXDir.dopus5 GETDIR' portname handle '""'
else
address command 'Delete >NIL: T:LZXDir.list'handle 'QUIET' /* remove temp file */
end
if upper(event)='DROP' then do
name=strip(name,'t')
if right(name,1)=':' then
lister read handle '"'name'"' force /* user dropped a volume icon */
end
call reply(packet,0)
end
end